﻿using System.Collections.Generic;

namespace Arch.Samples.RiaServices.Infrastructure
{
    public static class CollectionExtentions
    {
        public static void AddRange<T>(this ICollection<T> source, IEnumerable<T> collection)
        {
            foreach (var c in collection)
            {
                source.Add(c);
            }
        }

        public static void Reload<T>(this ICollection<T> source, IEnumerable<T> collection)
        {
            source.Clear();
            source.AddRange(collection);
        }
    }
}
